<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<select name="node_list" id="node_list" class="hidden">
		{:fill_option($node_list)}
	</select>
	<div class="popup-header">
		<h1>添加菜单</h1>
		<i class="mid"></i>
		<a class="btn btn-normal" onclick="save();">确定</a>
		<a class="btn btn-return" onclick="close_popup();">取消</a>
	</div>
	<div class="popup-body">
		<div class="popup-body-scroll">
			<div class="popup-content">
				<form id="form_data" name="form_data" method="post" >
					<input type="hidden" name="opmode" id="opmode" value="add">
					<div class="box">
						<label class="input-label" for="name">名称*：</label>
						<input class="input w19" type="text" id="name" name="name" check="required" info="请输入名称">
					</div>
					<div class="box">
						<label class="input-label" for="url">地址：</label>
						<input class="input w19" type="text" id="url" name="url">
					</div>
					<div class="box">
						<label class="input-label" for="url">父节点：</label>
						<input id="pid" name="pid" type="hidden" info="请选择父节点" check="required"  />
						<input class="input w13" id="node_name" name="node_name" type="text" readonly="readonly"/>
						<a class="add-on w6" onclick="select_pid()">选择 </a>
					</div>
					<div class="box">
						<label class="input-label" for="icon">图标：</label>
						<input class="input w19" type="text" id="icon" name="icon" >
					</div>
					<div class="box">
						<label class="input-label" for="badge_function">统计函数：</label>
						<input class="input w19" type="text" id="badge_function" name="badge_function" >
					</div>
					<div class="box">
						<label class="input-label" for="sort">排序：</label>
						<input class="input w10" type="text" id="sort" name="sort" >
					</div>

					<div class="box">
						<label class="input-label" for="is_del">状态*：</label>
						<select   name="is_del" id="is_del" class="select w10">
							<option  value="0">启用</option>
							<option value="1">禁用</option>
						</select>
						<i class="icon"></i>
					</div>
				</form>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use('global', function() {
			var fn = {
				save : function() {
					send_form('form_data', '{:url("save")}', '', function(ret) {
						if (ret.status == 1) {
							parent.layer.msg(ret.info, {
								time : 1200
							}, function() {
								parent.layer.close(index);
								parent.location.reload(true);
							});
						} else {
							parent.layer.msg(ret.info);
							return false;
						};
					});
				},
				close_popup : function() {
					parent.layer.close(index);
				},
				select_pid : function() {
					winopen("{:url('select_pid')}", 560, 470);
				},
			};
			win_exp(fn);
		});
	</script>

</block>